package com.fengmi.uc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fengmi.address.MallAddress;
import com.fengmi.sso.SysUser;
import com.fengmi.uc.filter.UserInfoInterceptor;
import com.fengmi.uc.mapper.MallAddressMapper;
import com.fengmi.uc.service.IMallAddressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author sujie
 * @since 2022-11-30
 */
@Service
public class MallAddressServiceImpl extends ServiceImpl<MallAddressMapper, MallAddress> implements IMallAddressService {

    @Override
    public List<MallAddress> getMallAddress() {
        //获取用户id
        String userId = UserInfoInterceptor.getUserInfo().getUserId();
        QueryWrapper<MallAddress> wrapper = new QueryWrapper<>();
        wrapper.eq("loc_member_id",userId);
        List<MallAddress> mallAddresses = this.baseMapper.selectList(wrapper);
        return mallAddresses;
    }
}
